import { Tooltip } from "antd";

export const renderToopTip = (title: string, length = 8) => {
  return title.length <= length ? (
    title
  ) : (
    <Tooltip title={title}>
      <span>{title.slice(0, length) + "..."}</span>
    </Tooltip>
  );
};

export const renderIndex = (
  index: number,
  tablePage: { current: number; pageSize: number }
) => <div>{index + 1 + (tablePage.current - 1) * tablePage.pageSize}</div>;
